package com.ruoyi.pos.domain;

import java.math.BigDecimal;

public class PosDingdanDetailVO {
    private Integer mendianId;
    private String name;
    private Integer goodsCount;
    private String price;
    private String productImg;
    private String dingdanCard;
    private String realName;
    private String phone;
    private String address;
    private Integer harvestWay;
    private String mendianName;
    private BigDecimal sumPrice;
    private String detailAddress;
    private String createTime;
    private String payWay;
    private String payWayName;

    public PosDingdanDetailVO(PosShangpin posShangpin,PosDingdan posDingdan,PosDingdanItem posDingdanItem){
           mendianId = posDingdanItem.getMendianId();
           payWay = posDingdan.getPayWay();
           if(Integer.parseInt(payWay) == 1){
               payWayName = "支付宝支付";
           }else if(Integer.parseInt(payWay) == 2){
               payWayName = "微信支付";
           }else if(Integer.parseInt(payWay) == 3){
               payWayName = "银行卡支付";
           }
           if(mendianId == 1){
               mendianName = "京东好店";
           }else if(mendianId == 2){
               mendianName = "淘宝好店";
           }else if(mendianId == 3){
               mendianName = "天猫好店";
           }else if(mendianId == 4){
               mendianName = "苏宁好店";
           }
           name = posShangpin.getName();
           goodsCount = posDingdanItem.getGoodsCount();
           price = posShangpin.getPrice();
           sumPrice = new BigDecimal(price).multiply(new BigDecimal(goodsCount));
           productImg = posShangpin.getProductImg();
           dingdanCard = posDingdan.getDingdanCard();
           realName = posDingdan.getRealName();
           phone = posDingdan.getPhone();
           address = posDingdan.getAddress();
           harvestWay = posDingdanItem.getHarvestWay();
           createTime = posDingdan.getCreateTime();
           if(harvestWay == 1){
               detailAddress = realName + phone + address;
           }else {
              String mendianAddress = "";
               if(mendianId == 1){
                   mendianAddress = ",地址: 沈阳市和平区南五马路";
               }else if(mendianId == 2){
                   mendianAddress = ",地址: 沈阳市浑南区奥体中心地铁B口附近";
               }else if(mendianId == 3){
                   mendianAddress = ",地址: 沈阳市铁西区铁西广场地铁A口附近";
               }else if(mendianId == 4){
                   mendianAddress = ",地址: 沈阳市浑南区长青街麦子屯附近";
               }
               detailAddress = realName + phone + "门店自提" + "(" + mendianName + mendianAddress + ")";
           }

    }



    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getGoodsCount() {
        return goodsCount;
    }

    public void setGoodsCount(Integer goodsCount) {
        this.goodsCount = goodsCount;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public String getDingdanCard() {
        return dingdanCard;
    }

    public void setDingdanCard(String dingdanCard) {
        this.dingdanCard = dingdanCard;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Integer getHarvestWay() {
        return harvestWay;
    }

    public void setHarvestWay(Integer harvestWay) {
        this.harvestWay = harvestWay;
    }

    public String getProductImg() {
        return productImg;
    }

    public void setProductImg(String productImg) {
        this.productImg = productImg;
    }

    public Integer getMendianId() {
        return mendianId;
    }

    public void setMendianId(Integer mendianId) {
        this.mendianId = mendianId;
    }

    public String getMendianName() {
        return mendianName;
    }

    public void setMendianName(String mendianName) {
        this.mendianName = mendianName;
    }

    public BigDecimal getSumPrice() {
        return sumPrice;
    }

    public void setSumPrice(BigDecimal sumPrice) {
        this.sumPrice = sumPrice;
    }

    public String getDetailAddress() {
        return detailAddress;
    }

    public void setDetailAddress(String detailAddress) {
        this.detailAddress = detailAddress;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getPayWay() {
        return payWay;
    }

    public void setPayWay(String payWay) {
        this.payWay = payWay;
    }

    public String getPayWayName() {
        return payWayName;
    }

    public void setPayWayName(String payWayName) {
        this.payWayName = payWayName;
    }
}
